import request from "../utils/request";

export const register = <P = any, V = any>(data: P) => {
  return request({
    url: `/user/register`,
    method: "post",
    data,
  }) as Promise<V>;
};

export const login = <P = any, V = any>(data: P) => {
  return request({
    url: `/user/login`,
    method: "post",
    data,
  }) as Promise<V>;
};

export const getUsers = <P = any, V = any>(params: P) => {
  return request({
    url: `/user`,
    method: "get",
    params,
  }) as Promise<V>;
};
